#!/usr/bin/python
#-*-coding:utf-8-*-

import smtplib
from email.mime.text import MIMEText
_user = "78713865@qq.com"
_pwd  = "scjbtbhfhiehbhfi"
_to   = "78713865@qq.com"


msg = MIMEText("你好，这是网站自动发送的邮件")
msg["Subject"] = "有人注册信息，请联系"
msg["From"]    = _user
msg["To"]      = _to

#使用MIMEText构造符合smtp协议的header及body
try:
    s = smtplib.SMTP_SSL("smtp.qq.com", 465)
    s.login(_user, _pwd)
    s.sendmail(_user, _to, msg.as_string())
    s.quit()
    print "Success!"
except smtplib.SMTPException,e:
    print "Falied,%s"%e
